<?php
$item_name = strlen($dcommittee['Committee']['item_name'])>2 ? $dcommittee['Committee']['item_name'] : 'Project';
?>
<p class='contentmenu'>
<?php
if(isset($prev)) { echo '[ '.$html->link($prev['Item']['name'],array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'items','action'=>'view','id'=>$prev['Item']['id'])).' ]'; } 
if(isset($next)) { echo '[ '.$html->link($next['Item']['name'],array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'items','action'=>'view','id'=>$next['Item']['id'])).' ]'; } 
?>
<br/>
<?php if(isset($permission['Decision']['Create']) && $permission['Decision']['Create']):?>
    [ <?php echo $html->link(__("Add new decision",true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'decisions','action'=>'add','itemid'=>$item['Item']['id'])); ?> ]
<?php endif;?>
[ <?php echo $html->link(__("Related files",true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'attachments','action'=>'index/'.$item["Item"]["id"])); ?> ]
<?php if($permission['Report']['View']): ?>
    <?php echo '[ '.$html->link(__("View Report",true),array('committee'=>$dcommittee['Committee']['short_name'],'controller'=>'reports','action'=>'project','id'=>$item['Item']['id']),array('target'=>'_blank')).' ]'; ?>
<?php endif;?>
</p>

<div class="items view">
<h2>
    <?php  echo ucwords($item_name);?>: <?php echo $item['Item']['name'];?>
</h2>

<div class="contentsummary">
    <ul>
    <li><span class="viewtitle"><?php __('Committee'); ?>:</span> <?php echo $item['Committee']['name'];?></li>
    <li><span class="viewtitle"><?php echo sprintf(__('%s Name',true),$item_name); ?>:</span> <?php echo $item['Item']['name'];?></li>
    <li><span class="viewtitle"><?php echo sprintf(__('%s Short Name',true),$item_name); ?>:</span> <?php echo $item['Item']['short_name']; ?></li>
    <li><span class="viewtitle"><?php __('Description'); ?>:</span> <?php echo $item['Item']['description']; ?></li>
    <?php if ($item['Item']['startdate']!='0000-00-00'){?>
        <li><span class="viewtitle"><?php __('Start date'); ?>:</span> <?php echo date(Configure::read('date_format'),strtotime($item['Item']['startdate'])) ?></li>
    <?php } ?>
    <?php if ($item['Item']['deadline']!='0000-00-00'){?>
        <li><span class="viewtitle"><?php __('End date'); ?>:</span> <?php echo date(Configure::read('date_format'),strtotime($item['Item']['deadline'])) ?></li>
    <?php } ?>
    </ul>
</div>


<?php echo $this->element('decision_list',array('data'=>$item,'model'=>'item')); ?>

</div>
